Types in MathNet.Numerics.LinearAlgebra
Public Methods
Matrix<T> Dense(int rows, int columns, Func<int, int, T> init)
Create a new dense matrix and initialize each value using the provided init function.
Matrix<T> Dense(int rows, int columns, T value)
Create a new dense matrix and initialize each value to the same provided value.
Matrix<T> Dense(int rows, int columns, T[] storage)
Create a new dense matrix with the given number of rows and columns directly binding to a raw array.
The array is assumed to be in column-major order (column by column) and is used directly without copying.
Very efficient, but changes to the array and the matrix will affect each other.
Matrix<T> Dense(int rows, int columns)
Create a new dense matrix with the given number of rows and columns.
All cells of the matrix will be initialized to zero.
Create a new dense matrix straight from an initialized matrix storage instance.
The storage is used directly without copying.
Intended for advanced scenarios where you're working directly with
storage for performance or interop reasons.
Matrix<T> DenseDiagonal(int rows, int columns, T value)
Create a new diagonal dense matrix and initialize each diagonal value to the same provided value.
Matrix<T> DenseDiagonal(int rows, int columns, Func<int, T> init)
Create a new diagonal dense matrix and initialize each diagonal value using the provided init function.
Matrix<T> DenseDiagonal(int order, T value)
Create a new diagonal dense matrix and initialize each diagonal value to the same provided value.
Matrix<T> DenseIdentity(int order)
Create a new diagonal dense identity matrix with a one-diagonal.
Matrix<T> DenseIdentity(int rows, int columns)
Create a new diagonal dense identity matrix with a one-diagonal.
Matrix<T> DenseOfColumnArrays(IEnumerable<T[]> columns)
Create a new dense matrix of T as a copy of the given column arrays.
This new matrix will be independent from the arrays.
A new memory block will be allocated for storing the matrix.
Matrix<T> DenseOfColumnMajor(int rows, int columns, IEnumerable<T> columnMajor)
Create a new dense matrix as a copy of the given enumerable.
The enumerable is assumed to be in column-major order (column by column).
This new matrix will be independent from the enumerable.
A new memory block will be allocated for storing the matrix.
Matrix<T> DenseOfColumns(int rows, int columns, IEnumerable<IEnumerable<T>> data)
Create a new dense matrix as a copy of the given enumerable of enumerable columns.
Each enumerable in the master enumerable specifies a column.
This new matrix will be independent from the enumerables.
A new memory block will be allocated for storing the matrix.
Matrix<T> DenseOfColumns(IEnumerable<IEnumerable<T>> data)
Create a new dense matrix as a copy of the given enumerable of enumerable columns.
Each enumerable in the master enumerable specifies a column.
This new matrix will be independent from the enumerables.
A new memory block will be allocated for storing the matrix.
Matrix<T> DenseOfColumnVectors(IEnumerable<Vector<T>> columns)
Create a new dense matrix as a copy of the given column vectors.
This new matrix will be independent from the vectors.
A new memory block will be allocated for storing the matrix.
Matrix<T> DenseOfColumnVectors(Vector`1[] columns)
Matrix<T> DenseOfDiagonalArray(T[] diagonal)
Create a new dense matrix with the diagonal as a copy of the given array.
This new matrix will be independent from the array.
A new memory block will be allocated for storing the matrix.
Matrix<T> DenseOfDiagonalArray(int rows, int columns, T[] diagonal)
Create a new dense matrix with the diagonal as a copy of the given array.
This new matrix will be independent from the array.
A new memory block will be allocated for storing the matrix.
Create a new dense matrix with the diagonal as a copy of the given vector.
This new matrix will be independent from the vector.
A new memory block will be allocated for storing the matrix.
Matrix<T> DenseOfDiagonalVector(int rows, int columns, Vector<T> diagonal)
Create a new dense matrix with the diagonal as a copy of the given vector.
This new matrix will be independent from the vector.
A new memory block will be allocated for storing the matrix.
Matrix<T> DenseOfIndexed(int rows, int columns, IEnumerable<Tuple<int, int, T>> enumerable)
Create a new dense matrix as a copy of the given indexed enumerable.
Keys must be provided at most once, zero is assumed if a key is omitted.
This new matrix will be independent from the enumerable.
A new memory block will be allocated for storing the matrix.
Create a new dense matrix as a copy of the given other matrix.
This new matrix will be independent from the other matrix.
A new memory block will be allocated for storing the matrix.
Matrix<T> DenseOfMatrixArray(Matrix`1[,] matrices)
Matrix<T> DenseOfRowArrays(IEnumerable<T[]> rows)
Create a new dense matrix of T as a copy of the given row arrays.
This new matrix will be independent from the arrays.
A new memory block will be allocated for storing the matrix.
Matrix<T> DenseOfRowMajor(int rows, int columns, IEnumerable<T> columnMajor)
Create a new dense matrix as a copy of the given enumerable.
The enumerable is assumed to be in row-major order (row by row).
This new matrix will be independent from the enumerable.
A new memory block will be allocated for storing the matrix.
Matrix<T> DenseOfRows(int rows, int columns, IEnumerable<IEnumerable<T>> data)
Create a new dense matrix as a copy of the given enumerable of enumerable rows.
Each enumerable in the master enumerable specifies a row.
This new matrix will be independent from the enumerables.
A new memory block will be allocated for storing the matrix.
Matrix<T> DenseOfRows(IEnumerable<IEnumerable<T>> data)
Create a new dense matrix as a copy of the given enumerable of enumerable rows.
Each enumerable in the master enumerable specifies a row.
This new matrix will be independent from the enumerables.
A new memory block will be allocated for storing the matrix.
Matrix<T> DenseOfRowVectors(IEnumerable<Vector<T>> rows)
Create a new dense matrix as a copy of the given row vectors.
This new matrix will be independent from the vectors.
A new memory block will be allocated for storing the matrix.
Matrix<T> Diagonal(T[] storage)
Create a new square diagonal matrix directly binding to a raw array.
The array is assumed to represent the diagonal values and is used directly without copying.
Very efficient, but changes to the array and the matrix will affect each other.
Matrix<T> Diagonal(int rows, int columns, T[] storage)
Create a new diagonal matrix with the given number of rows and columns directly binding to a raw array.
The array is assumed to represent the diagonal values and is used directly without copying.
Very efficient, but changes to the array and the matrix will affect each other.
Matrix<T> Diagonal(int rows, int columns, T value)
Create a new diagonal matrix and initialize each diagonal value to the same provided value.
Matrix<T> Diagonal(int rows, int columns, Func<int, T> init)
Create a new diagonal matrix and initialize each diagonal value using the provided init function.
Create a new diagonal matrix straight from an initialized matrix storage instance.
The storage is used directly without copying.
Intended for advanced scenarios where you're working directly with
storage for performance or interop reasons.
Matrix<T> Diagonal(int rows, int columns)
Create a new diagonal matrix with the given number of rows and columns.
All cells of the matrix will be initialized to zero.
Matrix<T> DiagonalIdentity(int rows, int columns)
Create a new diagonal identity matrix with a one-diagonal.
Matrix<T> DiagonalIdentity(int order)
Create a new diagonal identity matrix with a one-diagonal.
Matrix<T> DiagonalOfDiagonalArray(int rows, int columns, T[] diagonal)
Create a new diagonal matrix with the diagonal as a copy of the given array.
This new matrix will be independent from the array.
A new memory block will be allocated for storing the matrix.
Matrix<T> DiagonalOfDiagonalArray(T[] diagonal)
Create a new diagonal matrix with the diagonal as a copy of the given array.
This new matrix will be independent from the array.
A new memory block will be allocated for storing the matrix.
Create a new diagonal matrix with the diagonal as a copy of the given vector.
This new matrix will be independent from the vector.
A new memory block will be allocated for storing the matrix.
Matrix<T> DiagonalOfDiagonalVector(int rows, int columns, Vector<T> diagonal)
Create a new diagonal matrix with the diagonal as a copy of the given vector.
This new matrix will be independent from the vector.
A new memory block will be allocated for storing the matrix.
IIterationStopCriterion`1[] IterativeSolverStopCriteria(int maxIterations)
Create a new matrix straight from an initialized matrix storage instance.
If you have an instance of a discrete storage type instead, use their direct methods instead.
Create a new dense matrix with values sampled from the provided random distribution.
Matrix<T> Random(int rows, int columns)
Create a new dense matrix with values sampled from the standard distribution with a system random source.
Matrix<T> Random(int rows, int columns, int seed)
Create a new dense matrix with values sampled from the standard distribution with a system random source.
Create a new positive definite dense matrix where each value is the product
of two samples from the provided random distribution.
Matrix<T> RandomPositiveDefinite(int order)
Create a new positive definite dense matrix where each value is the product
of two samples from the standard distribution.
Matrix<T> RandomPositiveDefinite(int order, int seed)
Create a new positive definite dense matrix where each value is the product
of two samples from the provided random distribution.
Matrix<T> SameAs(Matrix<T> example, Matrix<T> otherExample, int rows, int columns, bool fullyMutable)
Create a new matrix with a type that can represent and is closest to both provided samples.
Matrix<T> SameAs(Vector<T> example, int rows, int columns)
Create a new matrix with the same kind of the provided example.
Create a new matrix with a type that can represent and is closest to both provided samples and the dimensions of example.
Create a new matrix with the same kind and dimensions of the provided example.
Matrix<T> SameAs<TU>(Matrix<T> example, int rows, int columns, bool fullyMutable)
Create a new matrix with the same kind of the provided example.
Matrix<T> Sparse(int rows, int columns, Func<int, int, T> init)
Create a new sparse matrix and initialize each value using the provided init function.
Create a new sparse matrix straight from an initialized matrix storage instance.
The storage is used directly without copying.
Intended for advanced scenarios where you're working directly with
storage for performance or interop reasons.
Matrix<T> Sparse(int rows, int columns)
Create a sparse matrix of T with the given number of rows and columns.
Parameters
int
rows
int
columns
Matrix<T> Sparse(int rows, int columns, T value)
Create a new sparse matrix and initialize each value to the same provided value.
Matrix<T> SparseDiagonal(int rows, int columns, T value)
Create a new diagonal sparse matrix and initialize each diagonal value to the same provided value.
Matrix<T> SparseDiagonal(int order, T value)
Create a new diagonal sparse matrix and initialize each diagonal value to the same provided value.
Matrix<T> SparseDiagonal(int rows, int columns, Func<int, T> init)
Create a new diagonal sparse matrix and initialize each diagonal value using the provided init function.
Matrix<T> SparseIdentity(int rows, int columns)
Create a new diagonal dense identity matrix with a one-diagonal.
Matrix<T> SparseIdentity(int order)
Create a new diagonal dense identity matrix with a one-diagonal.
Matrix<T> SparseOfColumnArrays(T[][] columns)
Matrix<T> SparseOfColumnArrays(IEnumerable<T[]> columns)
Create a new sparse matrix as a copy of the given column arrays.
This new matrix will be independent from the arrays.
A new memory block will be allocated for storing the matrix.
Matrix<T> SparseOfColumnMajor(int rows, int columns, IList<T> columnMajor)
Create a new sparse matrix with the given number of rows and columns as a copy of the given array.
The array is assumed to be in column-major order (column by column).
This new matrix will be independent from the provided array.
A new memory block will be allocated for storing the matrix.
Matrix<T> SparseOfColumns(int rows, int columns, IEnumerable<IEnumerable<T>> data)
Create a new sparse matrix as a copy of the given enumerable of enumerable columns.
Each enumerable in the master enumerable specifies a column.
This new matrix will be independent from the enumerables.
A new memory block will be allocated for storing the matrix.
Matrix<T> SparseOfColumns(IEnumerable<IEnumerable<T>> data)
Create a new sparse matrix as a copy of the given enumerable of enumerable columns.
Each enumerable in the master enumerable specifies a column.
This new matrix will be independent from the enumerables.
A new memory block will be allocated for storing the matrix.
Matrix<T> SparseOfColumnVectors(Vector`1[] columns)
Matrix<T> SparseOfColumnVectors(IEnumerable<Vector<T>> columns)
Create a new sparse matrix as a copy of the given column vectors.
This new matrix will be independent from the vectors.
A new memory block will be allocated for storing the matrix.
Matrix<T> SparseOfDiagonalArray(int rows, int columns, T[] diagonal)
Create a new sparse matrix with the diagonal as a copy of the given array.
This new matrix will be independent from the array.
A new memory block will be allocated for storing the matrix.
Matrix<T> SparseOfDiagonalArray(T[] diagonal)
Create a new sparse matrix with the diagonal as a copy of the given array.
This new matrix will be independent from the array.
A new memory block will be allocated for storing the matrix.
Matrix<T> SparseOfDiagonalVector(int rows, int columns, Vector<T> diagonal)
Create a new sparse matrix with the diagonal as a copy of the given vector.
This new matrix will be independent from the vector.
A new memory block will be allocated for storing the matrix.
Create a new sparse matrix with the diagonal as a copy of the given vector.
This new matrix will be independent from the vector.
A new memory block will be allocated for storing the matrix.
Matrix<T> SparseOfIndexed(int rows, int columns, IEnumerable<Tuple<int, int, T>> enumerable)
Create a new sparse matrix as a copy of the given indexed enumerable.
Keys must be provided at most once, zero is assumed if a key is omitted.
This new matrix will be independent from the enumerable.
A new memory block will be allocated for storing the matrix.
Create a new sparse matrix as a copy of the given other matrix.
This new matrix will be independent from the other matrix.
A new memory block will be allocated for storing the matrix.
Matrix<T> SparseOfMatrixArray(Matrix`1[,] matrices)
Matrix<T> SparseOfRowArrays(IEnumerable<T[]> rows)
Create a new sparse matrix as a copy of the given row arrays.
This new matrix will be independent from the arrays.
A new memory block will be allocated for storing the matrix.
Matrix<T> SparseOfRowMajor(int rows, int columns, IEnumerable<T> rowMajor)
Create a new sparse matrix as a copy of the given enumerable.
The enumerable is assumed to be in row-major order (row by row).
This new matrix will be independent from the enumerable.
A new memory block will be allocated for storing the vector.
Matrix<T> SparseOfRows(int rows, int columns, IEnumerable<IEnumerable<T>> data)
Create a new sparse matrix as a copy of the given enumerable of enumerable rows.
Each enumerable in the master enumerable specifies a row.
This new matrix will be independent from the enumerables.
A new memory block will be allocated for storing the matrix.
Matrix<T> SparseOfRows(IEnumerable<IEnumerable<T>> data)
Create a new sparse matrix as a copy of the given enumerable of enumerable rows.
Each enumerable in the master enumerable specifies a row.
This new matrix will be independent from the enumerables.
A new memory block will be allocated for storing the matrix.
Matrix<T> SparseOfRowVectors(Vector`1[] rows)
Matrix<T> SparseOfRowVectors(IEnumerable<Vector<T>> rows)
Create a new sparse matrix as a copy of the given row vectors.
This new matrix will be independent from the vectors.
A new memory block will be allocated for storing the matrix.
Public Properties
T One get;
Gets the value of 1.0
for type T.
T Zero get;
Gets the value of 0.0
for type T.